import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    //重定向
    redirect:"/login",
    children: [
      // 首页
      {
        path: 'index',
        name: 'Index',
        component: () => import("@/views/index/Index"),
      },
      
      //班级管理
      {
        path: 'clazz',
        name: 'Clazz',
        component: () => import("@/views/class-management/Clazz"),
      },
      // 学生信息
      {
        path: 'student',
        name: 'Student',
        component: () => import("@/views/student-info/Student"),
      },

       // 教师信息
       {
        path: 'teacher',
        name: 'Teacher',
        component: () => import("@/views/teacher-info/Teacher"),
      },

       // 年级信息
       {
        path: 'grade',
        name: 'Grade',
        component: () => import("@/views/grade-management/Grade"),
      },

      // 课程信息
      {
        path: 'course',
        name: 'Course',
        component: () => import("@/views/course-management/Course"),
      },

      // 成绩列表
      {
        path: 'examlist',
        name: 'examlist',
        component: () => import("@/views/exam-list/Exam"),
      },
      // 教学管理
      {
        path: 'teaching',
        name: 'Teaching',
        component: () => import("@/views/teacher-exam-list/Index"),
      },
      // 学生查看成绩
      {
        path: 'studnet_score',
        name: 'studnetScore',
        component: () => import("@/views/student-score/Index"),
      },
      // 用户信息
      {
        path: 'authority',
        name: 'Authority',
        component: () => import("@/views/authority-management/Authority"),
      },
      // 修改用户信息
      {
        path: 'person',
        name: 'Person',
        component: () => import("@/views/person-info/Person"),
       
      },
      // 学生个人信息（学生）
      {
        path: 'studentinfo',
        name: 'studentinfo',
        component: () => import("@/views/student-person-info/List"),
       
      },
      // 老师个人信息（老师）
      {
        path: 'teacherinfo',
        name: 'teacherinfo',
        component: () => import("@/views/teacher-person-info/List"),
       
      },
      // 成绩列表（老师）
      {
        path: 'teacherscorelist',
        name: 'teacherscorelist',
        component: () => import("@/views/teacher-student-scorelist/List"),
      },
    // 班主任信息
    {
      path: 'headmasterinfo',
      name: 'headmasterinfo',
      component: () => import("@/views/headmaster-info/Headmaster"),
    },

    // 学生信息（班主任）
    {
      path: 'headmasterstudentinfo',
      name: 'headmasterstudentinfo',
      component: () => import("@/views/headmaster-student-info/List"),
    },

    // 学生考试列表（班主任）
    {
      path: 'headmasterstudentexamlist',
      name: 'headmasterstudentexamlist',
      component: () => import("@/views/headmaster-student-examlist/List"),
    },

    // 学生成绩列表（班主任）
    {
      path: 'headmasterstudentscorelist',
      name: 'headmasterstudentscorelist',
      component: () => import("@/views/headmaster-student-scorelist/List"),
    },

     // 学生成绩列表（管理员）
     {
      path: 'adminscore',
      name: 'adminscore',
      component: () => import("@/views/admin-student-scorelist/List"),
    },
     // 数据可视画
     {
      path: 'data',
      name: 'data',
      component: () => import("@/views/data-visualization/Data"),
    },
     // 测试
     {
      path: 'test',
      name: 'test',
      component: () => import("@/views/test/test"),
    },
    ],
    },
    //用户登录
    {
      path: '/login',
      name: 'Login',
      component: () => import("@/views/login/Login")
  },
]
  
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
